<meta charset = "utf-8">
<button onclick = "col2()">-</button>
<input style = "width: 30px" value ="1" id = "num" onkeyup = "check()"/>库存10
<button onclick = "col1()">+</button>
<script>

	function check(){
	if(num.value>10) num.value = 10;
	
             }

	function col1 (){
	if (num.value == 10){
		num.value =10;
	}else{
		num.value = parseInt(num.value) +1;
	}
	
}

function col2 (){
	if (num.value == 0){
		num.value =0;
	}else{
		num.value = parseInt(num.value) -1;
	}
	
	
	
}
</script>
